<?

function loginFunction()
{
    /*
     * Change the HTML output so that it fits to your
     * application.
     */
    echo "<form method=\"post\" action=\"index.php\">";
    echo "Login: <input type=\"text\" name=\"username\"><br />";
    echo "Password:<input type=\"password\" name=\"password\"><br />";
    echo "<input type=\"submit\">";
    echo "</form>";
}

$params = array(
            "dsn" => $dsn,
            "table" => $tables['auth']
            );

$a = new Auth("DB",  $params, "loginFunction");

$a->start();

if (@$_GET['action'] == "logout" && $a->checkAuth()) {
    $a->logout();
    $a->start();
}

?>